Skip to content

Add a bit of lag to the JWT renewal time.#3592

Merged
mitchell-as merged 2 commits intoversion/0-48-0-RC1from
mitchell/dx-3151
Nov 14, 2024
Merged

Add a bit of lag to the JWT renewal time.#3592
mitchell-as merged 2 commits intoversion/0-48-0-RC1from
mitchell/dx-3151

Conversation

@mitchell-as
Copy link
Copy Markdown
Collaborator

@mitchell-as mitchell-as commented Nov 13, 2024

BugDX-3151 `state checkout` with expired JWT gives unhelpful error message

It was possible to land within the interval between actual expired time and expected expired time.

I did my best to try and reproduce this, but I wasn't able to. I genuinely think I landed in the brief window of time where the JWT expired on the Platform, but state-svc or state tool thought it was still valid. Reducing the time state-svc or state tool think it's valid should avoid this. Either way, it's not something our users will run into on a regular basis (and waiting a minute or two for the state-svc poller to refresh would have silently fixed this error).

It was possible to land within the interval between actual expired time and expected expired time.
@mitchell-as mitchell-as requested a review from Naatan November 14, 2024 18:41
@mitchell-as mitchell-as marked this pull request as ready for review November 14, 2024 18:41
Copy link
Copy Markdown
Contributor

@Naatan Naatan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is effectively duplicating the logic here:

if s.cutoffReached(time.Now()) {

Suggest instead lowering the lifetime to say 50 minutes:

const jwtLifetime = (1 * time.Hour) - (1 * time.Minute)

@mitchell-as mitchell-as requested a review from Naatan November 14, 2024 20:57
@mitchell-as mitchell-as merged commit bc92b12 into version/0-48-0-RC1 Nov 14, 2024
@mitchell-as mitchell-as deleted the mitchell/dx-3151 branch November 14, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants